package com.datang.pet.api.talkController;/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-07-01 11:44
 * @notify
 * @version 1.0
 */

import com.datang.pet.common.response.Result;
import com.datang.pet.common.utils.MD5;
import com.datang.pet.service.TalkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeleteTalkController {

    @Autowired
    private TalkService talkService;

    @GetMapping("/deleteTalk")
    public Result deleteTalk(String userId,String id)throws Exception{
        try {
            userId = MD5.decryptData(userId);
        } catch (Exception e) {
            throw new Exception("userId解密出错！");
        }
        talkService.deleteTalk(userId,id);
        return Result.ok("ok");
    }
}
